package com.yxw.live_vod_backend_boot.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yxw.live_vod_backend_boot.entity.YxProductCategoryEntity;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

/**
 * 商品类目管理Mapper接口
 *
 * @author xiexuxin
 * @date 2023-12-06
 */
@Repository
public interface ProductCategoryMapper extends BaseMapper<YxProductCategoryEntity> {

    /**
     * 商品类目启用/禁用
     * @param categoryId
     */
    @Update("update yx_product_category set is_enable = case when is_enable = 0 then 1 else 0 end where category_id = #{categoryId}")
    void isEnableCategoryById(@Param("categoryId") String categoryId);

}
